# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=jack_mixer
pkgver=17
pkgrel=3
pkgdesc="Jack desktop mixer application"
arch=('loong64' 'x86_64')
url="https://github.com/jack-mixer/jack_mixer"
license=('GPL2')
groups=('pro-audio')
depends=('gcc-libs' 'glibc' 'hicolor-icon-theme' 'python-cairo'
'python-gobject' 'python-xdg')
makedepends=('cython' 'glib2' 'jack2' 'meson' 'python-docutils')
optdepends=('new-session-manager: for session management')
source=("$pkgname-$pkgver.tar.gz::https://github.com/jack-mixer/${pkgname}/archive/release-${pkgver//./-}.tar.gz")
sha512sums=('1ffe39682b40ffca8f4d3e84b13ce1deff77be68f5fe7f37a715d8eebfe7806b909c4d8e4aa178cd6410263df45b855e7db61c7bd068fcae437b7772b215751a')
b2sums=('a6c66f9e68bb9f7b61341b5497eac9966fcdba277fea47b114494f5b93bdcf35020c600b6d732499f9322233f48b8f6c4335ee1a509055a1a63c9072581a59ef')

prepare() {
  mv -v "$pkgname-release-${pkgver//./-}" "$pkgname-$pkgver"
}

build() {
  cd "$pkgname-$pkgver"
  arch-meson --prefix=/usr \
             --libdir=lib \
             --buildtype=release \
             build
  ninja -C build
}

check() {
  cd "$pkgname-$pkgver"
  meson test -C build
}

package() {
  depends+=('libglib-2.0.so' 'libjack.so')
  cd "$pkgname-$pkgver"
  DESTDIR="${pkgdir}" meson install -C build
  install -vDm 644 *.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
